<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="swipper1">
        <img src="" alt="">
        <button>1 上一张</button>
        <button>1 下一张</button>
    </div>

    <div id="swipper2">
        <img src="" alt="">
        <button>2 上一张</button>
        <button>2 下一张</button>
    </div>

    <script>
        var oSwipper1 = document.getElementById('swipper1');
        var oImg1 = oSwipper1.getElementsByTagName('img')[0];
        var oBtns1 = oSwipper1.getElementsByTagName('button');
        console.log(oSwipper1, oImg1, oBtns1);

        console.log(oSwipper1.querySelector('img'), oSwipper1.querySelectorAll('button') );

        var oSwipper2 = document.getElementById('swipper2');
        var oImg2 = oSwipper2.getElementsByTagName('img')[0];
        var oBtns2 = oSwipper2.getElementsByTagName('button');
        console.log(oSwipper2, oImg2, oBtns2);

    </script>
</body>
</html>